package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AgentOrderFallBack;
import cn.cs.pojo.AgentOrder;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-agent-provider", configuration = CsConfiguration.class, fallback = AgentOrderFallBack.class)
public interface AgentOrderClient {

    @RequestMapping(value = "/getAgentOrderById", method = RequestMethod.POST)
    public AgentOrder getAgentOrderById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getAgentOrderListByMap", method = RequestMethod.POST)
    public List<AgentOrder> getAgentOrderListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAgentOrderCountByMap", method = RequestMethod.POST)
    public Integer getAgentOrderCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addAgentOrder", method = RequestMethod.POST)
    public Integer addAgentOrder(@RequestBody AgentOrder agentOrder) throws Exception;

    @RequestMapping(value = "/modifyAgentOrder", method = RequestMethod.POST)
    public Integer modifyAgentOrder(@RequestBody AgentOrder agentOrder) throws Exception;

    @RequestMapping(value = "/deleteAgentOrderById", method = RequestMethod.POST)
    public Integer deleteAgentOrderById(@RequestParam("id") String id) throws Exception;

}

